package com.example.common.mapper;

import com.example.common.entity.OpenApiApp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author DestinyCc
 * @Entity com.example.common.entity.OpenApiApp
 */
@Mapper
public interface OpenApiAppMapper extends MyBatisBaseDao<OpenApiApp, Long>{
    /**
     * 通过email查询app
     * @param email
     * @return
     */
    List<OpenApiApp> listAllByEmail(@Param("email") String email);

    /**
     * 通过appId和Secret查询应用
     * @return
     */
    OpenApiApp getByAppIdSecret(@Param("appId") String appId,
                                @Param("appSecret") String appSecret);

    /**
     * 通过email和appId查询应用
     */
    OpenApiApp getByIdAppId(@Param("id") String id,
                            @Param("appId") String appId);
}
